1. Field of the Invention
This invention is intended for enlargement processing of an image represented with a multi-step gradation and relates in particular to an image processing apparatus, an image processing method, an image processing program, and a computer-readable record medium storing the image processing program for suppressing occurrence of image quality defects of blurring and jaggies, in an input image and performing enlargement processing of the image with high quality.
2. Description of the Related Art
Image enlargement processing is one type of basic processing for a system for editing, filing, displaying, and printing, images. In recent years, with the widespread of image data mainly intended for display at a monitor display resolution to view an Internet web site or a digital video, high-quality enlargement processing has been becoming important increasingly to produce the high-quality output result in printing the low-resolution images on a high-resolution printer.
Nearest neighbor method, linear interpolation or bilinear method, and cubic convolution method are available as existing techniques of performing enlargement processing of an image represented with a multi-step gradation, which will be hereinafter referred to as a multilevel image.
The nearest neighbor method is a method of using as each pixel value after enlargement, the pixel value of the nearest pixel when each pixel is inversely mapped onto the original image. The nearest neighbor method can be processed at high speed since it involves small computation amount, but one pixel of the original image is enlarged intact to a rectangular shape. Thus, jaggies occur in an oblique line portion or if the magnification is large, the image becomes mosaic; the degree of image quality degradation is large.
The linear interpolation or bilinear method is a method of assuming that the pixel value between pixels changes linearly, and linearly interpolating the pixel values of four nearby pixels of the inverse map point of pixel after enlargement to find the pixel value. The linear interpolation or bilinear method involves heavier processing load than the nearest neighbor, but involves comparatively small computation amount and jaggies occur less. On the other hand, the linear interpolation or bilinear method has disadvantage in that the whole image becomes blurred centering on the edge portions not applied to the assumption of linear change.
The cubic convolution method is a method of defining an interpolation function approximating a sinc function (sin(x)/x) based on a sampling theorem and performing convolution of 16 nearby pixels of the inverse map point of pixel after enlargement (four by four pixels in the X and Y direction) and the approximate interpolation function to find the pixel value after enlargement. This method provides comparatively good image quality as compared with the two techniques described above, but involves a large reference range and large computation amount and has a characteristic of high-frequency enhancement. Thus, the cubic convolution has disadvantages in that light jaggies occur in the edge portions and the noise component is enhanced.
As attempts to solve the problems, techniques are proposed in JP-A-7-182503, JP-A-2000-228723, JP-A-2000-253238, “Tekioutekina nijigen hyouhonka kansuu niyoru kouhinshituna gazoukakudaisaikousei” (Gazou Denshi Gakkaishi Vol. 28 No. 5 P.P. 620–626).
In JP-A-7-182503, the maximum value and the minimum value are detected from pixels of an N×M area (for example, 3×3) surrounding a notable pixel and further contrast and an intermediate value are calculated and based on the contrast, either the maximum value or the minimum value and an average value of other values are derived as representative values. Next, linear interpolation or bilinear processing of the notable pixel to N×M pixels is performed, binarization is executed with the calculated intermediate value as a threshold value, and the two representative values are placed according to the result of the binarization. If the contrast is small, the pixel values of the linear interpolation or bilinear processing are used intact, whereby a final enlarged image is provided.
Accordingly, no jaggies occur and good conversion with no interpolation blurring even in a natural image is possible. However, there is a problem that the edge parts are determined based only on the contrast and that it is difficult to reproduce edges directions. There is also a problem that block-like distortion occurs in the edge part since the N×M area is made up of two values only.
In JP-A-2000-228723, an original image is binarized, and from the binary image, the direction of an oblique component contained in the original image is found by making a match determination with a provided two-dimensional pattern (matrix data), and interpolation processing is found along the found oblique direction. In other portions, linear interpolation or bilinear processing is performed.
Since the original image is binarized according to a predetermined threshold value before the direction determination of the oblique component is made, the method is effective for edges with large density difference, but involves a problem in reproducing edges with small density difference.
In JP-A-2000-253238, linear interpolation or bilinear processing is performed for an original image to enlarge the original image and in parallel, each surrounding N×M area containing a notable pixel in the original image is binarized, and a match determination with a preset oblique line detection pattern is made. If the notable pixel belongs to an edge area (matches the oblique line detection pattern), its direction information is mapped to the notable pixel. Further, the direction information is mapped to the enlarged image provided by performing the linear interpolation or bilinear processing, and smoothing filtering along the direction of the mapped direction information is performed, whereby enlargement processing with jaggy occurrence suppressed is performed.
However, the technique described in JP-A-2000-253238 is a sequence of enlargement of the original image, pattern matching, enlargement of the direction information, and direction-dependent smoothing filtering for the enlarged image, so that the technique involves a problem of the processing load becoming very large as the image size becomes large.
In the cubic convolution, an error is caused by using an approximation function with the sinc function discarded finitely because the sinc function is an infinite series, and the sampling theorem aims at continuous and differentiable signals; whereas the art described in “Tekioutekina nijigen hyouhonka kansuu niyoru kouhinshituna gazoukakudaisaikousei” (Gazou Denshi Gakkaishi Vol. 28 No. 5 P.P. 620–626) introduces the fact that an image contains a large number of discontinuous points as a problem, uses a function fitted for discontinuity and having locality, different from the sinc function as an interpolation function, detects the edge direction globally, and deforming the interpolation function in the detected edge direction, thereby providing an enlarged image with less occurrence of blurring and jaggies.
The function used in the technique is local, but the convolution matrix size becomes 4n relative to magnification n and the edge direction is detected globally and thus there is a problem of a large computation amount.